package com.jida.tijian.service;

import com.jida.tijian.domain.Orders;
import com.jida.tijian.dto.ResponseObject;
import com.jida.tijian.mapper.OrdersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    OrdersMapper ordersMapper;

    @Override
    public ResponseObject saveOrders(Orders orders){
        //现根据体检预约日期和用户账号查询订单表，看该用户当天是否有其他预约。
        //如果有的话，抛出异常，该用户当天已有预约

        ordersMapper.insert(orders);

        return new ResponseObject(ResponseObject.SUCCESS_STATUS,ResponseObject.SUCCESS_DESC);
    }
}
